package com.spzx.product.api.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spzx.common.core.web.domain.BaseEntity;
import com.spzx.product.api.domain.ProductSku;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

import java.util.List;

@Data
@TableName(value = "product")
@Schema(description = "商品管理表")
public class Product extends BaseEntity {
    @Schema(description = "商品名称")
    @TableField(value = "name")
    @NotBlank
    private String name;
    @Schema(description = "品牌Id")
    @TableField(value = "brand_id")
    private Long brandId;
    @Schema(description = "品牌名称")
    @TableField(exist = false)
    private String brandName;
    @Schema(description = "1级分类Id")
    @TableField(value = "category1_id")
    private Long category1Id;
    @Schema(description = "2级分类Id")
    @TableField(value = "category2_id")
    private Long category2Id;
    @Schema(description = "3级分类Id")
    @TableField(value = "category3_id")
    private Long category3Id;
    @Schema(description = "1级分类名称")
    @TableField(exist = false)
    private String category1Name;
    @Schema(description = "2级分类名称")
    @TableField(exist = false)
    private String category2Name;
    @Schema(description = "3级分类名称")
    @TableField(exist = false)
    private String category3Name;
    @Schema(description = "计量单位")
    @TableField(value = "unit_name")
    private String unitName;
    @Schema(description = "轮播图")
    @TableField(value = "slider_urls")
    private String sliderUrls;
    @Schema(description = "商品规格JSON")
    @TableField(value = "spec_value")
    private String specValue;
    @Schema(description = "上线状态:0:初始;1:上架;-1:自主下架")
    @TableField(value = "status")
    private Short status;
    @Schema(description = "审核状态:0:初始;1:审核通过;-1:审核未通过")
    @TableField(value = "audit_status")
    private Short auditStatus;
    @Schema(description = "审核信息")
    @TableField(value = "audit_message")
    private String auditMessage;

    @TableField(exist = false)
    @Schema(description = "商品详情图片列表")
    private List<String> productDetailsIdList;
    @TableField(exist = false)
    @Schema(description = "商品SKUId列表")
    private List<ProductSku> productSkuList;
}
